<script setup>
import axios from "axios";
import { ref, onMounted } from "vue";

let form = ref({
  productId: "",
  deviceId: "",
  date1: null,
  date2: null,
  resource: "",
  desc: "",
});

var parameters = ref({});

onMounted(() => {
  axios.get("http://192.168.1.100:9090/factory/setting/get").then((res) => {
    console.log(res);
    if (res.data.success) {
      parameters.value = res.data.data;
    }
  });
});
</script>

<template>
  <el-form :model="form" label-width="auto" style="max-width: 600px">
    <el-form-item label="产品型号">
      <el-input v-model="form.productId" />
    </el-form-item>
    <el-form-item label="设备型号">
      <el-input v-model="form.deviceId" />
    </el-form-item>
    <el-form-item label="硬件版本">
      <el-input v-model="form.hw_version" />
    </el-form-item>
    <el-form-item label="软件版本">
      <el-input v-model="form.sw_version" />
    </el-form-item>
    <el-form-item label="设备类型">
      <el-radio-group v-model="form.type">
        <el-radio value="盘刷版">盘刷版</el-radio>
        <el-radio value="滚刷版">滚刷版</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="生产日期">
      <el-date-picker v-model="form.date1" type="date" placeholder="选择日期" style="width: 100%" />
    </el-form-item>

    <el-form-item label="速度设置">
      <el-col :span="4" style="text-align: right"> 行走速度： </el-col>
      <el-col :span="4">
        <el-input v-model="form.sw_version" />
      </el-col>
      <el-col :span="4" style="text-align: right"> 延边速度： </el-col>
      <el-col :span="4">
        <el-input v-model="form.sw_version" />
      </el-col>
      <el-col :span="4" style="text-align: right"> 梯控速度： </el-col>
      <el-col :span="4">
        <el-input v-model="form.sw_version" />
      </el-col>
    </el-form-item>
    <el-form-item label="HTTP服务器地址">
      <el-input v-model="form.http_server" />
    </el-form-item>
    <el-form-item label="MQTT服务器地址">
      <el-input v-model="form.mqtt_server" />
    </el-form-item>
    <el-form-item label="运维服务器地址">
      <el-input v-model="form.ops_server" />
    </el-form-item>

    <el-form-item label="选配">
      <el-switch v-model="form.delivery" text="阿斯顿" />
    </el-form-item>
    <el-form-item label="选配">
      <el-checkbox-group v-model="form.type2">
        <el-checkbox value="Online activities" name="type"> 3D激光 </el-checkbox>
        <el-checkbox value="Promotion activities" name="type"> 防跌落 </el-checkbox>
        <el-checkbox value="Offline activities" name="type"> 全包围撞板 </el-checkbox>
        <el-checkbox value="Simple brand exposure" name="type"> Simple brand exposure </el-checkbox>
      </el-checkbox-group>
    </el-form-item>
    <el-form-item label="Resources">
      <el-radio-group v-model="form.resource">
        <el-radio value="Sponsor">Sponsor</el-radio>
        <el-radio value="Venue">Venue</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="Activity form">
      <el-input v-model="form.desc" type="textarea" />
    </el-form-item>
    <!-- <el-form-item>
      <el-button type="primary" @click="onSubmit">Create</el-button>
      <el-button>Cancel</el-button>
    </el-form-item> -->
  </el-form>
</template>

<style lang="scss" scoped></style>
